const Koa = require("koa");
const json = require("koa-json");
const logger = require("koa-logger");
const koaRoute = require("koa-router");
const bodyParse = require("koa-bodyparser");

const app = new Koa();
const route = new koaRoute();

const auth = require("./src/server/routes/auth");

//middleware
route.use("/auth", auth.routes());//给所有auth请求路径的文件加上/auth的前缀

//中间件
app.use(json());
app.use(bodyParse());
app.use(logger());

app.listen(1234, () => {
  console.log("server-start");
});
module.exports = app;